package cn.ld.module.ai.dal.mapper.mindmap;

import cn.ld.framework.common.pojo.PageResult;
import cn.ld.framework.mybatis.core.mapper.BaseMapperX;
import cn.ld.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ld.module.ai.controller.admin.mindmap.vo.AiMindMapPageInVO;
import cn.ld.module.ai.dal.entity.mindmap.AiMindMapEntity;
import org.apache.ibatis.annotations.Mapper;

/**
 * AI 思维导图 Mapper
 *
 * @author xiaoxin
 */
@Mapper
public interface AiMindMapMapper extends BaseMapperX<AiMindMapEntity> {

    default PageResult<AiMindMapEntity> selectPage(AiMindMapPageInVO inVO) {
        return selectPage(inVO, new LambdaQueryWrapperX<AiMindMapEntity>()
                .eqIfPresent(AiMindMapEntity::getUserId, inVO.getUserId())
                .eqIfPresent(AiMindMapEntity::getPrompt, inVO.getPrompt())
                .betweenIfPresent(AiMindMapEntity::getCreateTime, inVO.getCreateTime())
                .orderByDesc(AiMindMapEntity::getId));
    }

}
